<template>
  <aside>
    <!-- 节点属性 -->
    <div>
      <ul>
        <li>
          <label>节点Id</label>
          <Input
            disabled
            v-model="content.id"
            style="width: 100%"
          />
        </li>
        <li>
          <label>节点类型</label>
          <Input
            disabled
            v-model="content.type"
            style="width: 100%"
          />
        </li>
        <li>
          <label>节点名称</label>
          <Input
            v-model="content.name"
            style="width: 100%"
          />
        </li>

        <li>
          <label>数据存入变量
            <el-tooltip class="item" effect="light" placement="right">
              <template slot="content">
                每句sql执行结果存入变量，可供下一句sql使用<br/>
                用法：设变量是dataList<br/>
                使用第一条insert执行返回主键：dataList[0]<br/>
                使用第二条select执行结果列表的，第一条记录，id字段数据：dataList[1][0].id
              </template>
              <i class="el-icon-warning"></i>
            </el-tooltip>
          </label>
          <Input
              v-model="content.defineVarName"
              style="width: 100%"
          />
        </li>

        <li>
          <label>sql脚本
            <el-tooltip class="item" effect="light" placement="right">
              <template slot="content">
                SQL: <br/>
                insert into ttf_test_script(id, name) value(${item.id}, ${item.name}); <br/>
                select id, name from ttf_test_script where name=${param2.name};
              </template>
              <i class="el-icon-warning"></i>
            </el-tooltip>
          </label>
          <el-input
            type="textarea"
            :rows="15"
            v-model="content.script"
            style="width: 100%"
          />
        </li>

        <li>
          <label>打印变量日志</label>
          <el-checkbox
            v-model="content.isPrintLog"
            style="width: 100%"
            label="是否打印日志"
          />
        </li>


        <li>
          <label>节点描述</label>
          <el-input
                  type="textarea"
                  :rows="2"
                  v-model="content.description"
                  style="width: 100%"
          />
        </li>

      </ul>
    </div>
  </aside>
</template>

<script>
export default {
  name: "CodeSqlCodeAttr",
  props: {
    selectContent:Object
  },
  data() {
    return {
      content: {},
      type: "",
      jspInit: this.$store.state.taskflow.jspInit,
    };
  },
  watch:{
    selectContent: {
      handler(nval) {
        if (!nval) {
          return
        }
        this.content = nval.data;
        this.type = nval.type;
      },
      immediate: true
    }
  },
  mounted() {
  },
  methods: {
  },
};
</script>

<style scoped lang="scss">
  aside {
    padding: 10px;
    ul {
      list-style: none;
      li {
        margin-bottom: 5px;
        > label {
          display: block;
          font-size: 15px;
          font-weight: normal;
          margin-bottom: 2px;
        }
      }
    }
  }
</style>
